﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Show.aspx.cs" Inherits="JinJiang.BookingEngine.Web.cn.Show" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="css/hubs1_dfb.css" type="text/css" rel="Stylesheet" />
    <script language="javascript" type="text/javascript" src="JS/calendar1.js"></script>
    <script language="javascript" type="text/javascript" src="JS/JSDateFunction.js"></script>
    <script language="javascript" type="text/javascript" src="JS/resetiframe.js"></script>
</head>
<body id="bodyBooking" runat="server">
    <form id="mainForm" runat="server">
    <table width="100%" cellpadding="0" cellspacing="0">
        <tr>
            <td>
                <div class="Frame">
                    <!--div class="RightContentTitle">
                    酒店详细</div-->
                </div>
                <div id="Div1">
                    <script language="JavaScript" type="text/javascript">

                        function setCheckInDate(d) {
                            document.getElementById("<%= txtStartTime.ClientID %>").value = d;
                            ShowDate("<%= txtStartTime.ClientID %>");
                        }
                        function ShowDate(v) {
                            if (document.getElementById(v).id == document.getElementById("<%= txtStartTime.ClientID %>").id) {
                                var Value = document.getElementById("<%= txtStartTime.ClientID %>").value.split('-');
                                var day = Value[2];
                                var month = parseInt(Value[1], 10);
                                var year = Value[0];
                                document.getElementById("<%= txtDepTime.ClientID %>").value = addDate(year, month, day);
                                showCalendar('dimg2', false, "<%= txtDepTime.ClientID %>", "<%= txtStartTime.ClientID %>", null);
                            }
                            else {
                                showCalendar('dimg2', false, "<%= txtDepTime.ClientID %>", "<%= txtStartTime.ClientID %>", null);
                            }
                        }
                        function DateValidate() {
                            var d1 = document.getElementById("<%= txtStartTime.ClientID %>").value.split('-');
                            var d2 = document.getElementById("<%= txtDepTime.ClientID %>").value.split('-');
                            var today = new Date();
                            var yesterday = today.getDate() - 1;
                            var Date1 = new Date(d1[0] + "/" + d1[1] + "/" + d1[2]);
                            if (Date1 < yesterday) {
                                alert('入住日期必须大于等于今天.请重新输入');
                                document.getElementById("<%= txtStartTime.ClientID %>").value = addDate(today.getFullYear(), today.getMonth() + 1, today.getDate());
                                document.getElementById("<%= txtDepTime.ClientID %>").value = addDate(today.getFullYear(), today.getMonth() + 1, today.getDate() + 1);
                                return false;
                            }
                            var Date2 = new Date(d2[0] + "/" + d2[1] + "/" + d2[2]);
                            Date1.setDate(Date1.getDate() + 30);
                            if (Date2 > Date1) {
                                alert('预订日期必须在30天之内.请重新输入');
                                document.getElementById("<%= txtDepTime.ClientID %>").value = addDate(d1[0], d1[1], d1[2]);
                                return false;
                            }
                            return true;
                        }
                        function addDate(year, month, day) {
                            var today = new Date(year, month - 1, day);
                            today.setDate(today.getDate() + 1);
                            return (today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate());
                        }

                        function startTimeclick() {
                            showCalendar("dimg1", false, "<%= txtStartTime.ClientID %>", "<%= txtStartTime.ClientID %>", "setCheckInDate");

                        }
                        function endTimeclick() {
                            ShowDate("<%= txtDepTime.ClientID %>");
                        }
                    </script>
                    <div id="main">
                        <table class="table_NoBoder" border="1" style="display: none">
                            <tbody>
                                <tr>
                                    <td style="height: 74px; width: 80px;" align="center">
                                        <asp:Image ID="imgHotel" runat="server" CssClass="grayboder" BorderWidth="1" />
                                    </td>
                                    <td>
                                        <asp:Label ID="lblHotelName" runat="server" CssClass="font_message"></asp:Label>
                                        <hr width="98%" noshade size="1" />
                                        星级：
                                        <asp:Label ID="lblStar" runat="server"></asp:Label>
                                        &nbsp; 货币种类：
                                        <asp:Label ID="lblCurrency" runat="server"></asp:Label>
                                        &nbsp;&nbsp; 价格范围：
                                        <asp:Label ID="lblPrice" runat="server"></asp:Label>
                                        <br />
                                        地址：
                                        <asp:Label ID="lblAddress" runat="server"></asp:Label>
                                        &nbsp;&nbsp; 电话:
                                        <asp:Label ID="lblPhone" runat="server"></asp:Label>&nbsp;<br />
                                        <asp:HiddenField ID="hdfadults" runat="server" />
                                        <asp:HiddenField ID="hdfnights" runat="server" />
                                        <asp:HiddenField ID="hdfpropertyID" runat="server" />
                                        <asp:HiddenField ID="hdfCheckoutdate" runat="server" />
                                        <asp:HiddenField ID="hdfCheckindate" runat="server" />
                                        <asp:HiddenField ID="hdfrateClass" runat="server" />
                                        <asp:HiddenField ID="hdfRoomType" runat="server" />
                                        <asp:HiddenField ID="hdfchildren" runat="server" />
                                        <asp:HiddenField ID="hdfroom" runat="server" />
                                        <asp:HiddenField ID="hdfspcode" runat="server" />
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <script language="javascript" src="JS/loader.js" type="text/javascript"></script>
                        <br />
                        <table class="table_NoBoder">
                            <tr>
                                <td valign="top">
                                    <table class="table_NoBoder">
                                        <tr>
                                            <td>
                                                入住日期：<br />
                                                <asp:TextBox ID="txtStartTime" onfocus="this.blur()" onclick="javascript:startTimeclick();" runat="server" Columns="10"></asp:TextBox>
                                                <a onclick="event.cancelBubble=true;" href="javascript:startTimeclick()">
                                                    <img id="dimg1" height="21" src="images/calendar.gif" width="25" align="absmiddle" border="0" /></a>
                                            </td>
                                            <td>
                                                离店日期：<br />
                                                <asp:TextBox ID="txtDepTime" runat="server" onfocus="this.blur()" onclick="javascript:endTimeclick();" Columns="10"></asp:TextBox>
                                                <a onclick="event.cancelBubble=true;" href="javascript:endTimeclick();">
                                                    <img id="dimg2" height="21" src="images/calendar.gif" width="25" align="absmiddle" border="0" /></a>
                                            </td>
                                            <td>
                                                房间数：<br />
                                                <asp:DropDownList ID="dropRoom" runat="server" Width="55px">
                                                    <asp:ListItem Selected="True" Value="1">1</asp:ListItem>
                                                    <asp:ListItem Value="2">2</asp:ListItem>
                                                    <asp:ListItem Value="3">3</asp:ListItem>
                                                    <asp:ListItem Value="4">4</asp:ListItem>
                                                    <asp:ListItem Value="5">5</asp:ListItem>
                                                </asp:DropDownList>
                                            </td>
                                            <td>
                                                人/间：<br />
                                                <asp:DropDownList ID="dropAdult" runat="server" Width="48px">
                                                    <asp:ListItem Selected="True" Value="1">1</asp:ListItem>
                                                    <asp:ListItem Value="2">2</asp:ListItem>
                                                </asp:DropDownList>
                                            </td>
                                            <td>
                                                <asp:CheckBox ID="chkall" runat="server" Text="所有价格" />
                                            </td>
                                            <td align="center">
                                                <input type="button" onclick="SearchHotel()" value=" 搜索价格>> " class="btnGo" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="6">
                                                <div id="divErr">
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                    <br />
                                    <!--Loading-->
                                    <div id="loadErrinfo" align="center" style="display: none;">
                                        获取数据出错...请刷新页面重试<br />
                                        <br />
                                    </div>
                                    <div id="loadTimeoutinfo" align="center" style="display: none;">
                                        系统繁忙，预订请联系800-819-5677,400-670-5677客服中心<br />
                                        <br />
                                    </div>
                                    <!--Loading结束-->
                                    <div id="divRate">
                                    </div>
                                    <script language="javascript" type="text/javascript" defer="defer">

                                        function SearchHotel() {
                                            var hdfroom = document.getElementById("<%= dropRoom.ClientID %>").value;
                                            var hdfadults = document.getElementById("<%= dropAdult.ClientID %>").value;
                                            var hdfchildren = document.getElementById("<%= hdfchildren.ClientID %>").value;
                                            var hdfCheckindate = document.getElementById("<%= txtStartTime.ClientID %>").value;
                                            var hdfCheckoutdate = document.getElementById("<%= txtDepTime.ClientID %>").value;
                                            var hdfpropertyID = document.getElementById("<%= hdfpropertyID.ClientID %>").value;
                                            var hdfspcode = document.getElementById("<%= hdfspcode.ClientID %>").value;
                                            if (DateValidate()) {
                                                JinJiang.BookingEngine.Web.cn.Show.CheckRates(hdfspcode, hdfCheckindate, hdfCheckoutdate, hdfpropertyID, hdfadults, hdfchildren, hdfroom, document.getElementById("chkall").checked, '<%= domainurl %>', Hotel, null, hide_show());
                                            }
                                        }

                                        function Hotel(request) {
                                            var str = request.value;
                                            document.getElementById("divRate").innerHTML = str;
                                            hideloadinfo();
                                            fSetOutLinkIframe('<%= domain %>');
                                        }
                                    </script>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </td>
        </tr>
    </table>
    </form>
    <br />
    <br />
    <asp:Panel ID="googlejs" runat="server">
        <script type="text/javascript">
            var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
            document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
        </script>
        <script type="text/javascript">
            try {
                var pageTracker = _gat._getTracker("UA-10768010-1");
                pageTracker._trackPageview();
            } catch (err) { }
        </script>
    </asp:Panel>
</body>
</html>
